<template>
   <Workflowdesign v-model="entity.nodes" :inputs="entity.inputs" />
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import Workflowdesign from './create/workflow-design.vue';
import type { WorkflowDefinition } from '@/utils/api/workflow/definition/type';
import { getAsync } from '@/utils/api/workflow/definition';

// 定义流程对象
const entity = ref<WorkflowDefinition>({
    id: '',
    title: '',
    version: 1,
    description: '',
    icon: '',
    color: 'rgba(255, 69, 0, 0.68)',
    group: '',
    inputs: [],
    nodes: []
});

onMounted(async () => {
    const workflowDefinition = await getAsync('1001','222');
    entity.value = workflowDefinition;
});
</script>
